package com.example.demo2_review.design_pattern.behavioral_patterns.observer_pattern;

/**
 * @Author zwp14
 * @create 2024/6/25 1:00
 * @description 具体观察者1号
 */
public class BinaryObserver extends Observer{

    public BinaryObserver(Subject subject){
        this.subject = subject;
        this.subject.addObservers(this);
    }

    @Override
    public void update() {
        System.out.println( "Binary String: " + Integer.toBinaryString( subject.getState() ) );
    }
}
